// class left {
  
// }

class Maybe {
  static of (x) {
    return new Maybe(x)
  }
  isNothing () {//判断函子是否为空
    return this._value === null || this._value === undefined
  }
  constructor(x) {
    this._value = x
  }
  map (fn) {
    return this.isNothing() ? this : Maybe.of(fn(this._value))
  }
}